﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.Designer.Views
{
    public partial class EventProxy
    {
        private static object s_lockObj = new object();
        public static EventProxy s_instance;
        public static EventProxy Instance
        {
            get
            {
                if (s_instance == null)
                {
                    lock (s_lockObj)
                    {
                        if (s_instance == null)
                        {
                            s_instance = new EventProxy();
                        }
                    }
                }
                return s_instance;
            }
        }

        public DesignView DesignView { get; private set; }

        public void SetDesignView(DesignView designView)
        {
            DesignView = designView;
        }

        /// <summary>
        /// 离线模式
        /// </summary>
        public bool IsOfflineMode { get; set; }

        private EventProxy()
        {
            IsOfflineMode = true;
        }

        #region set solution

        [Common.Subscribe]
        public void OnReceiveSetSolutionEvent(Event.Core.CoreSetSolutionEvent @event)
        {
        }

        #endregion

        #region open scene

        [Common.Subscribe]
        public void OnReceiveCoreOpenSceneEvent(Event.Core.CoreOpenSceneEvent @event)
        {
            //DesignView.API_OpenScene(@event.SceneName);
        }

        #endregion
    }
}
